#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int main() {
    int A, B;
    scanf("%d %d", &A, &B);
    printf("%d %d", A * B - A - B, ((A - 1) * (B - 1)) / 2);
    return 0;
}